package com.neusoft.bizcore.activiti.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;
import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.activiti.enums.PendingDataStatusEnum;
import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

/**
 * @author WYS
 * @date 2020年9月8日 上午9:43:27
 */
@Getter
@Setter
@Entity
@Proxy(lazy = false)
@org.hibernate.annotations.Table(appliesTo = "wf_pending_data", comment = "待处理业务数据")
@Table(name = "wf_pending_data")
public class PendingData extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    @Length(max = 255, message = "工作流instanceId不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '工作流instanceId'")
    private String instanceId;

    @Length(max = 255, message = "工作流taskId不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '工作流taskId'")
    private String taskId;

    @Length(max = 255, message = "工作流nodeId不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '工作流nodeId'")
    private String nodeId;

    @Length(max = 50, message = "工单号不能超过{max}位")
    @Column(length = 50, nullable = false)
    @Comment("varchar(50) NOT NULL COMMENT '工单号'")
    private String workNum;

    @Length(max = 500, message = "业务操作类")
    @Column(length = 500, nullable = false)
    @Comment("varchar(500) NOT NULL COMMENT '业务操作类'")
    private String clazzName;

    @Length(max = 500, message = "业务操作方法名")
    @Column(length = 500, nullable = false)
    @Comment("varchar(500) NOT NULL COMMENT '业务操作方法名'")
    private String methodName;

    @Length(max = 255, message = "业务名称")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255) NULL COMMENT '业务名称'")
    private String name;

    @Lob
    @Column(columnDefinition = "longtext", nullable = false)
    @Comment("text COMMENT '业务数据'")
    private String content;

    @Enumerated(EnumType.STRING)
    @Column(length = 25, nullable = true)
    @Comment("varchar(25) NULL COMMENT '处理状态'")
    private PendingDataStatusEnum status = PendingDataStatusEnum.undeal;

    @Length(max = 500, message = "备注说明")
    @Column(length = 500, nullable = true)
    @Comment("varchar(500) NULL COMMENT '备注说明'")
    private String remarks;

}
